<?php
require_model('base.class');
class registrationOperation extends base {
    private $table = 'RegistrationOperation';
    private $primary = 'OperationId';
    function __construct() {
        parent::__construct($this->table,$this->primary);
    }
    function CreateOperation() {

    }
    function GetOperationByRegistrationId($registrationId,$page=false, array & $request) {
        if($page) {
            $obj = $this->db->create_mapper($this->table)->where(array('RegistrationId'=>$registrationId));
            return load_model('page')->list_page($obj, $request);
        }else {
            return $this->get_items(array('RegistrationId'=>$registrationId));
        }
    }
    function GetLatestOperationByRegistrationId($registrationId) {
        return $this->db->create_mapper($this->table)->where(array('RegistrationId'=>$registrationId))->order('OperationTime')->find_by();
    }
}